refactor(types)!: Page/App/Dashboard 渲染节点不再占用 spec 的文档名 (#4115 B 组) - #3074
Merged
Conversation
… spec's document names (objectstack#4115 group B)
Group B is the `type`-semantics collision: the spec's `type` IS the page /
dashboard kind (`record|app|utility|list|home`), while objectui's `type`
is the component discriminator (`'page'`) and the kind lives on
`pageType`. So a spec-authored `{type: 'list'}` page failed objectui's
schema and an objectui page's `pageType` was silently dropped by spec's —
under names that told every reader the two were the same thing.
Renamed to the *ComponentSchema convention group A settled on (node =
*ComponentSchema, union = *UnionSchema), with no back-compat aliases:
AppSchema -> AppComponentSchema
DashboardSchema -> DashboardComponentSchema
PageSchema -> PageNodeSchema
Page is a deliberate exception to the convention: `PageComponentSchema`
is ALREADY a `@objectstack/spec/ui` export — and it means a component
*inside* a page region (`{type: PageComponentType, properties, …}`), not
the page itself. Taking that name would have rebuilt the exact defect
this issue exists to remove, one concept over. The guard caught it: the
first pass of this commit used `PageComponentSchema` and failed by name.
Ledger 129 -> 126, regenerated with `--ledger` and diffed entry by entry:
removals are exactly these three, no other package's debt dropped.
Mutation-tested in both directions — re-declaring the node as `PageSchema`
*and* as `PageComponentSchema` each fail the guard by name and file.
78/78 type-check; full suite 8701 assertions green.
BREAKING CHANGE: `AppSchema`, `DashboardSchema` and `PageSchema` are
renamed in `@object-ui/types` (and its `/zod` entry point) with no
aliases. Every in-repo consumer is updated here, including apps/console.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
按维护者指示:B 组沿用 A 组敲定的
*ComponentSchema约定,不做别名过渡。B 组是什么
type的语义冲突:spec 的type是页面/仪表盘的种类(record|app|utility|list|home),objectui 的type是组件判别式('page'),种类被挪到了pageType。后果是 spec 写法{type:'list'}的页面在 objectui 这边直接校验失败,而 objectui 页面的pageType在 spec 那边被静默丢弃 —— 偏偏两者顶着同一个名字,读代码的人会认为它们是一回事。AppSchemaAppComponentSchemaDashboardSchemaDashboardComponentSchemaPageSchemaPageNodeSchema← 约定的例外,见下Page 为什么不叫
PageComponentSchemaPageComponentSchema本身已经是@objectstack/spec/ui的导出,而且它指的是页面区域内部的一个组件({type: PageComponentType, properties, …}),不是页面本身。用这个名字等于把本 issue 要消灭的缺陷原样搬到隔壁概念上 —— 下一个读到 objectuiPageComponentSchema的人会以为它就是 spec 那个区域组件。这不是推演出来的:本 PR 第一版真的用了
PageComponentSchema,被守卫按名拦下。所以 Page 改用PageNodeSchema(spec 未占用),App/Dashboard两个*ComponentSchema则是空闲的,照常。方法:仍然让 tsc 当裁判
这三个名字比 A 组那批高频得多(225 处、约 40 个文件),而且 spec 与本地引用混在同一文件,所以替换时跳过注释行与含
@objectstack/spec的行,整份排除三个「名字指向 spec」的文件(app-shell/…/page-schema.ts、dashboard-schema.ts、clientValidation.ts)。过程中被 tsc / 守卫抓到两个我自己的疏漏,都已修正:
@objectstack/spec(路径在结尾行),导致 4 处 spec 导入别名被误改成PageComponentSchema as SpecPageSchema。特征是…ComponentSchema as Spec…,已全部还原。apps/目录漏扫 —— 我的扫描只覆盖了packages/,apps/console/src/schemas/objectDetailPageSchema.ts被漏掉,tsc 报了出来。顺带回查确认 A 组(refactor(types)!: rename the 15 symbols that only collided with a spec name (#4115 A 组) #3068)在apps/下确实没有引用,那轮的 78/78 是真绿而非侥幸。验证
--ledger重生成并逐条 diff:removed 恰为这三个、added 为空;PageSchema→ 守卫按名+按文件报红;改成PageComponentSchema(我差点提交的陷阱名)→ 同样报红;type-check78/78;BREAKING CHANGE
@object-ui/types及其/zod入口的这三个导出改名且无别名。仓内所有消费者已更新,包括apps/console、packages/layout、packages/runner、packages/components、packages/plugin-dashboard、packages/plugin-designer、packages/app-shell、packages/core。🤖 Generated with Claude Code